#ifndef PLUGINSINT_H
#define PLUGINSINT_H

#include <QtPlugin>
#include <QLayout>
#include <QIcon>
#include <QIODevice>
#include <QList>
#include <QUrl>
#include <DataStructures.h>




/*
*/
class signalSlotStratum : public QObject
{
	Q_OBJECT
public:
	inline signalSlotStratum(QObject *parent) : QObject(parent) {}
signals:
// from plugin:
	void totalError(QString errorMessage);
	void startNextFile(int index); // actually, gives an index in list of file being uploaded.
	void updateStatus(int value, int max);
	void updateStatus(int value, int max, int index);
	void fileUploaded(int index, UploadResult result);
	void fileUploadFailed(int fileIndex, QString errorMessage);
	void uploadComplete(QList<UploadResult> result); // all files uploaded

// to plugin:
	void cancelUpload();
	void retranslate();
};


#include <QtDebug>

class uploadPluginClass
{
public:
	virtual ~uploadPluginClass() {}
	AboutPlugin About;
	virtual QLayout* getSettingsTab(QWidget *Tab) { qDebug() << "No settings for this plugin"; return 0; }

	inline void setIdentifier(QString id) { this->identifier = id; }
	inline QString getIdentifier() { return(this->identifier); }

	virtual void startUpload(QList<ImageToUpload> images, QObject *Stratum) = 0;

	static inline QString __lang() { return QT_TRANSLATE_NOOP("MyTranslator", "English");}
	virtual void retranslate() { qDebug() << "not implemented for this plugin";}
private:
	QString identifier;
};







class addImagePluginStratum : public QObject
{
	Q_OBJECT
public:
	inline addImagePluginStratum(QObject *parent) : QObject(parent) {}
signals:
// to plugin:
	void testSignal();
	void retranslate();

// from plugin:
	void addMyWidget(QWidget *myWidget);
	void addImage(QString imageName);
	void addImage(QIODevice *image);
};




class addImagePluginClass
{

public:
//	virtual ~addImagePluginClass() {}
	virtual void retranslate() { qDebug() << "not implemented for this plugin";}
	AboutPlugin About;

	virtual void setStratum(addImagePluginStratum *Stratum) = 0;
	virtual QGridLayout* getSettingsTab(QWidget *Tab) { Q_UNUSED(Tab); return 0; }
	static inline QString __lang() { return QT_TRANSLATE_NOOP("MyTranslator", "English");}
protected:
	addImagePluginStratum *Stratum;
};


Q_DECLARE_INTERFACE(addImagePluginClass, "com.trolltech.Plugin.addImagePluginClass/1.0")

Q_DECLARE_INTERFACE(uploadPluginClass, "com.trolltech.Plugin.PluginClass/1.0")


#endif
